package com.wht.media.controller;

import com.wht.media.common.R;
import com.wht.media.model.param.TranscodeParam;
import com.wht.media.service.ITranscodeService;
import org.noear.solon.annotation.*;
import org.noear.solon.validation.annotation.Validated;

/**
 * 转码
 *
 * @author by HaiTao.Wang on 2025/9/12.
 */
@Controller
@Mapping("transcode")
public class TranscodeController {

    @Inject
    ITranscodeService iTranscodeService;

    /**
     * 转码 默认H265转H264 支持分辨率调整 暂时只支持视频转码，音频因为各种封装格式对编码格式、音频参数等转换规则复杂暂时不支持
     * (windows环境 转码后测试延迟4秒)
     *
     * @param param
     * @return
     */
    @Post
    @Mapping
    public R transcode(@Validated @Body TranscodeParam param) {
        return iTranscodeService.transcode(param);
    }
}
